package com.atguigu.day03.test;

import java.util.Scanner;

public class ScannerExer {
    public static void main(String[] args) {
        //创建一个Scanner对象;
        //创建一个Scanner对象;
        Scanner sc = new Scanner(System.in);
        System.out.println("欢迎登录本网站");
        System.out.println("请在下面输入你的相关信息");
        System.out.println("----------------------------------");
        System.out.println("请输入你的名字:");
        //调用字符串型,记录名字
        String name = sc.next();
        System.out.println("请输入你的年龄:");
        //调用Int整形,记录年龄
        int age = sc.nextInt();
        System.out.println("请输入你的体重(kg):");
        //调用double型,记录体重
        double weight = sc.nextDouble();
        System.out.println("请输入你的身高(cm):");
        //调用float型,记录身高
        float height = sc.nextFloat();
        System.out.println("请输入你的性别:");
        //调用char型,记录性别,char型调用和别的不一样,需要注意
        sc.nextLine();
        char gender = sc.nextLine().charAt(0);
        //char gender = sc.next().charAt(0);
        System.out.println("是否有男/女朋友,true/false:");
        //调用boolean型,用来记录是否有对象
        boolean couple = sc.nextBoolean();
        System.out.println("姓名: " + name);
        System.out.println("年龄: " + age);
        System.out.println("体重: " + weight + "公斤");
        System.out.println("身高: " + height + "cm");
        System.out.println("性别: " + gender);
        System.out.println(couple ? "我有对象啦" : "老光棍一个,求追");

        sc.close();
    }
}
